File tree Expand file tree Collapse file tree 6 files changed +80
-16
lines changed Expand file tree Collapse file tree 6 files changed +80
-16
lines changed Original file line number Diff line number Diff line change 30
30
* .exe
31
31
* .out
32
32
* .app
33
+
34
+ build
35
+ src /constants.hpp
Original file line number Diff line number Diff line change @@ -8,8 +8,6 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
8
8
9
9
project (
10
10
ChangeMe
11
- LANGUAGES CXX
12
- VERSION 0.1.0
13
11
DESCRIPTION "ChangeMe"
14
12
HOMEPAGE_URL https://github.com/hugsy/ChangeMe
15
13
)
Original file line number Diff line number Diff line change 1
- project (ProjectTools )
1
+ project (Examples )
2
2
3
- #
4
- # Build test tools
5
- #
6
- set (PROJECT_TOOLS_DIR ${PROJECT_ROOT_DIR} /tools CACHE INTERNAL "PROJECT_TOOLS_DIR" )
3
+ set (PROJECT_EXAMPLES_DIR ${PROJECT_ROOT_DIR} /examples CACHE INTERNAL "PROJECT_EXAMPLES_DIR" )
4
+
5
+ set (
6
+ EXAMPLES_DIRS
7
+
8
+ # Populate here
9
+ )
10
+
11
+ foreach (EXAMPLE ${EXAMPLES_DIRS} )
12
+ file (GLOB SOURCE_FILES ${PROJECT_EXAMPLES_DIR} /${EXAMPLE}/*.cpp ${PROJECT_EXAMPLES_DIR} /${EXAMPLE}/*.asm )
13
+ add_executable (${EXAMPLE} WIN32 ${SOURCE_FILES} )
14
+ install (TARGETS ${EXAMPLE} DESTINATION Examples )
15
+ install (FILES $< TARGET_PDB_FILE:${EXAMPLE} > DESTINATION Examples/Debug OPTIONAL )
16
+ endforeach ()
Original file line number Diff line number Diff line change 1
- project (ProjectLib )
1
+ project (ChangeMe
2
+ LANGUAGES CXX
3
+ VERSION 0.1.0 )
2
4
3
5
set (PROJECT_LIB_SRC_DIR ${PROJECT_ROOT_DIR} /src CACHE INTERNAL "PROJECT_LIB_SRC_DIR" )
4
6
5
7
#
6
8
# Create the constants.hpp macro file
7
9
#
8
10
configure_file (
9
- "constants.hpp.in"
10
- "constants.hpp"
11
+ "${PROJECT_LIB_SRC_DIR} / constants.hpp.in"
12
+ "${PROJECT_LIB_SRC_DIR} / constants.hpp"
11
13
NEWLINE_STYLE WIN32
12
14
)
13
15
14
16
#
15
17
# Print out cmake compile info
16
18
#
17
19
message (STATUS "CMAKE_MODULE_PATH: ${CMAKE_MODULE_PATH} " )
18
- message (STATUS "CMAKE_CXX_LINK_EXECUTABLE: ${CMAKE_CXX_LINK_EXECUTABLE} " )
19
- message (STATUS "CMAKE_CXX_LINK_FLAGS: ${CMAKE_CXX_LINK_FLAGS} " )
20
- message (STATUS "CMAKE_EXE_LINKER_FLAGS: ${CMAKE_EXE_LINKER_FLAGS} " )
21
- message (STATUS "CMAKE_EXE_LINKER_FLAGS_RELEASE: ${CMAKE_EXE_LINKER_FLAGS_RELEASE} " )
22
- message (STATUS "CMAKE_SHARED_LINKER_FLAGS: ${CMAKE_SHARED_LINKER_FLAGS} " )
23
- message (STATUS "CMAKE_SHARED_LINKER_FLAGS_RELEASE: ${CMAKE_SHARED_LINKER_FLAGS_RELEASE} " )
24
20
message (STATUS "CMAKE_SYSTEM_PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR} " )
25
21
message (STATUS "CMAKE_SYSTEM_NAME: ${CMAKE_SYSTEM_NAME} " )
22
+
23
+ add_library (${PROJECT_NAME} STATIC lib.cpp )
24
+
25
+ install (TARGETS ${PROJECT_NAME} DESTINATION ${PROJECT_NAME} /Library )
Original file line number Diff line number Diff line change
1
+ #pragma once
2
+ #include <string_view>
3
+
4
+ // clang-format off
5
+ ///
6
+ ///@brief
7
+ ///
8
+ constexpr std::wstring_view LibraryName = L"@PROJECT_NAME@";
9
+
10
+ ///
11
+ ///@brief
12
+ ///
13
+ constexpr std::wstring_view LibraryAuthor = L"@PROJECT_AUTHOR@";
14
+
15
+ ///
16
+ ///@brief
17
+ ///
18
+ constexpr std::wstring_view LibraryLicense = L"@PROJECT_LICENSE@";
19
+
20
+ ///
21
+ ///@brief
22
+ ///
23
+ constexpr std::wstring_view LibraryBanner = L"@PROJECT_NAME@" L" v" L"@PROJECT_VERSION_MAJOR@" L"." L"@PROJECT_VERSION_MINOR@" L"." L"@PROJECT_VERSION_PATCH@";
24
+ // clang-format on
Original file line number Diff line number Diff line change
1
+ #ifdef _WIN32
2
+ #include < windows.h>
3
+
4
+ BOOL WINAPI
5
+ DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved)
6
+ {
7
+ switch ( fdwReason )
8
+ {
9
+ case DLL_PROCESS_ATTACH:
10
+ case DLL_PROCESS_DETACH:
11
+ case DLL_THREAD_ATTACH:
12
+ case DLL_THREAD_DETACH:
13
+ break ;
14
+ }
15
+
16
+ return TRUE ;
17
+ }
18
+
19
+ #else
20
+ static __attribute__ ((constructor)) void
21
+ on_attach_routine(void )
22
+ {
23
+ }
24
+
25
+ static void __attribute__ ((destructor))
26
+ on_detach_routine()
27
+ {
28
+ }
29
+ #endif // _WIN32
You can’t perform that action at this time.
0 commit comments