Skip to content

Commit

Permalink
Split into src/ and include/ with install configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
thosakwe committed Feb 25, 2019
1 parent 09d0af7 commit b908263
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 8 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,19 @@ cmake_minimum_required(VERSION 3.9)
project(t2b)

set(CMAKE_CXX_STANDARD 11)
set(T2B_SOURCES t2b.cc t2b.hpp)
set(T2B_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include)
set(T2B_SOURCES src/t2b.cc include/t2b.hpp)

add_library(t2b SHARED ${T2B_SOURCES})
add_library(t2b_static STATIC ${T2B_SOURCES})
add_executable(t2b_exe main.cc)
add_executable(t2b_exe src/main.cc)
set_target_properties(t2b_static t2b_exe PROPERTIES OUTPUT_NAME t2b)
target_include_directories(t2b PUBLIC ${T2B_INCLUDE_DIRS})
target_include_directories(t2b_exe PUBLIC ${T2B_INCLUDE_DIRS})
target_include_directories(t2b_static PUBLIC ${T2B_INCLUDE_DIRS})
target_link_libraries(t2b_exe t2b)
install(TARGETS t2b t2b_exe
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
ARCHIVE DESTINATION lib)
install(DIRECTORY include DESTINATION include)
File renamed without changes.
2 changes: 1 addition & 1 deletion main.cc → src/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <fstream>
#include <iostream>
#include <sstream>
#include "t2b.hpp"
#include <t2b.hpp>

using namespace t2b;

Expand Down
2 changes: 1 addition & 1 deletion t2b.cc → src/t2b.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <iostream>
#include <sstream>
#include <regex>
#include "t2b.hpp"
#include <t2b.hpp>

using namespace t2b;

Expand Down

0 comments on commit b908263

Please sign in to comment.